import HomePage_HeaderOperationComponent from "../../component/headerOperation"
import { ReactComponent as EventStatisticsSvg } from '../../../../assets/svg/eventStatistics.svg'
import { ReactComponent as RecordsOperationsSvg } from '../../../../assets/svg/recordsOperations.svg'
import { ReactComponent as SubstationLedgerSvg } from '../../../../assets/svg/substationLedger.svg'
import { ReactComponent as CurveAnalysisSvg } from '../../../../assets/svg/curveAnalysis.svg'
import { ReactComponent as HistoryDataSvg } from '../../../../assets/svg/historyData.svg'
import { ReactComponent as NumericalAnalysisSvg } from '../../../../assets/svg/numericalAnalysis.svg'
import { ReactComponent as AssessmentReportSvg } from '../../../../assets/svg/assessmentReport.svg'
import { Outlet } from "react-router-dom"
import { $echartsData, $headerOperationBtnData, $headerOperationConditionData } from "../../../../common/utils"

// 主页-统计查询页面
const HomePage_StatisticalQueryPage: React.FC = () => {

  const tabList = [
    {
      svg: EventStatisticsSvg,
      title: "事件统计",
      router: "eventStatistics",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("查询", "search", {}, true)
        ],
        conditionList: [
          $headerOperationConditionData["dateTimePickerRange"]("发生时间", ["startTime", "endTime"]),
          $headerOperationConditionData["dateTimePickerRange"]("确认时间", ["confirmStartTime", "confirmEndTime"]),
          $headerOperationConditionData["monitoringType"](),
          $headerOperationConditionData["singleBtn"]("事件对象"),
          $headerOperationConditionData["dataType"],
          $headerOperationConditionData["warningLevel"],
        ],
        singleBtnKey: "deviceID",
        singleBtnValueKey: "deviceID",
        selectMonitorOperation: "监测",
        initParamsData: {
          startTime: "",
          endTime: "",
          confirmStartTime: "",
          confirmEndTime: "",
          monitoringType: "全部",
          deviceID: "",
          dataType: "全部",
          warningLevel: "全部",
        },
      },

    },
    // {
    //   svg: RecordsOperationsSvg,
    //   title: "操作记录",
    //   router: "recordsOperations",
    //   operationData: {
    //     btnList: [
    //       $headerOperationBtnData("导出","export"),
    //       $headerOperationBtnData("查询","search", {}, true)
    //     ],


    //     conditionList: [
    //       $headerOperationConditionData["dateTimePickerRange"]("发生时间", "发生时间"),
    //       $headerOperationConditionData["singleBtn"]("安装站点", "站点"),
    //       $headerOperationConditionData["input"]("操作或监护人", "操作或监护人"),
    //     ]
    //   }
    // },
    {
      svg: SubstationLedgerSvg,
      dropdownName: "ledger",
      dropdownList: [
        {
          title: "站点台账",
          router: "substationLedger",
          parentName: "ledger",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["singleBtn"]("站点", "站点"),
              $headerOperationConditionData["voltageLevel"],
            ],
            singleBtnKey: "id",
            singleBtnValueKey: "id",
            initParamsData: {
              id: "",
              volLevel: "全部"
            }
          }

        },
        {
          title: "主变台账",
          router: "mainTransformerLedger",
          parentName: "ledger",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["monitoringDevice"](false, "monitorDevice", "主变类型"),
              $headerOperationConditionData["singleBtn"]("监测主变", "主变"),
            ],
            singleBtnKey: "id",
            singleBtnValueKey: "id",
            initParamsData: {
              id: "",
              monitorDevice: "全部",
              mailingAddress: ""
            }
          }
        },
        {
          title: "隔直台账",
          router: "separateLedger",
          parentName: "ledger",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["singleBtn"]("安装站点", "站点"),
              $headerOperationConditionData["input"]("装置型号", "deviceModel"),
            ],
            singleBtnKey: "stationID",
            singleBtnValueKey: "id",
            initParamsData: {
              stationID: "",
              deviceModel: "",
            }
          }
        },
        {
          title: "线路台账",
          router: "lineLedger",
          parentName: "ledger",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["dataType"]("类型", 3),
              $headerOperationConditionData["singleBtn"]("监测站点", "站点"),
            ],
            singleBtnKey: "id",
            singleBtnValueKey: "id",
            initParamsData: {
              dataType: "全部",
              id: "",
            }
          }
        },
      ]
    },
    {
      svg: CurveAnalysisSvg,
      title: "曲线分析",
      router: "curveAnalysis",
      operationData: {
        isLayoutSetting: true
      }
    },
    {
      svg: HistoryDataSvg,
      dropdownName: "historyData",
      dropdownList: [
        {
          title: "主变历史数据",
          router: "mainTransformerHistoryData",
          parentName: "historyData",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["dateTimePickerRange"]("统计时间", ["startTime", "endTime"]),
              $headerOperationConditionData["singleBtn"]("监测主变", "主变"),
            ],
            singleBtnKey: "id",
            singleBtnValueKey: "id",
            selectMonitorOperation: "监测",
            initParamsData: {
              startTime: "",
              endTime: "",
              id: "",
            },
          }
        },
        {
          title: "线路历史数据",
          router: "lineHistoryData",
          parentName: "historyData",
          operationData: {
            btnList: [
              $headerOperationBtnData("导出", "export"),
              $headerOperationBtnData("查询", "search", {}, true)
            ],
            conditionList: [
              $headerOperationConditionData["dateTimePickerRange"]("统计时间", ["startTime", "endTime"]),
              $headerOperationConditionData["singleBtn"]("监测线路", "线路"),
            ],
            singleBtnKey: "id",
            singleBtnValueKey: "id",
            selectMonitorOperation: "监测",
            initParamsData: {
              startTime: "",
              endTime: "",
              id: "",
            },
          }
        }
      ]
    },
    // {
    //   svg: NumericalAnalysisSvg,
    //   dropdownName: "numericalAnalysis",
    //   dropdownList: [
    //     {
    //       title: "主变数值分析",
    //       router: "mainTransformerNumericalAnalysis",
    //       parentName: "numericalAnalysis",
    //       operationData: {
    //         btnList: [
    //           $headerOperationBtnData("导出","export"),
    //           $headerOperationBtnData("查询","search", {}, true)
    //         ],
    //         conditionList: [
    //           $headerOperationConditionData["singleBtn"]("主变", "主变"),
    //         ]
    //       }
    //     },
    //     {
    //       title: "线路数值分析",
    //       router: "lineNumericalAnalysis",
    //       parentName: "numericalAnalysis",
    //       operationData: {
    //         btnList: [
    //           $headerOperationBtnData("导出","export"),
    //           $headerOperationBtnData("查询","search", {}, true)
    //         ],
    //         conditionList: [
    //           $headerOperationConditionData["singleBtn"]("线路", "线路"),
    //         ]
    //       }
    //     },

    //   ]
    // },
    {
      svg: AssessmentReportSvg,
      title: "评估报告",
      router: "assessmentReport",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("新增", "add")
        ],
        conditionList: [
          $headerOperationConditionData["dateTimePickerRange"]("统计时间", ["startTime", "endTime"]),
          $headerOperationConditionData["assessmentType"],
          $headerOperationConditionData["singleBtn"]("安装站点", "站点"),
        ]
      }

    },
  ]
  return (
    <div className="homePage-page">
      <HomePage_HeaderOperationComponent tabList={tabList} />
      <main className="homePage-page__main">
        <Outlet />
      </main>
    </div>
  )
}

export default HomePage_StatisticalQueryPage